// const person = {
//   name: 'zhangsan',
//   age: 23
// }
// const p = new Proxy(person,{
//   //监听对象属性的删除操作
//   deleteProperty(target,property){
//     console.log('delete',property)
//     delete target[property]
//   }
// })
// delete p.name
// console.log(p)
const list = []
const listProxy = new Proxy(list,{
  set(target,property,value){
    console.log('set',property,value)
    target[property] = value
    return true //必须返回true，表示设置成功
  }
})
listProxy.push(122)
// set 0 122
// set length 1